package a.i.a;

import a.c.*;
import a.c.e;
import a.c.k;
import a.c.q;
import a.i.p;

public class o
  implements m
{
  x a;
  x b;
  q c;
  z d;
  int e;
  public static int f;
  
  public o(q paramq)
  {
    this.c = paramq;
    this.a = paramq.B();
    this.b = paramq.B();
    this.d = new z();
    this.e = 0;
  }
  
  public o(q paramq, k paramk, int paramInt1, int paramInt2)
  {
    this(paramq, paramk, paramInt1, paramInt2, null);
  }
  
  public o(q paramq, k paramk1, int paramInt1, int paramInt2, k paramk2)
  {
    this(paramq);
    a(paramk1, paramInt1, paramInt2, paramk2);
  }
  
  void a(k paramk1, int paramInt1, int paramInt2, k paramk2)
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    bb[] arrayOfbb = new bb[paramInt2 - paramInt1 + 1];
    int i = paramInt1;
    if (i <= paramInt2)
    {
      arrayOfbb[i] = new a_(i);
      i++;
    }
    Object localObject;
    int j;
    for (;;)
    {
      if (!bool2) {
        if (!bool1)
        {
          if (!bool1) {
            break;
          }
          if (bool2) {
            continue;
          }
          w localw1 = this.c.v();
          do
          {
            do
            {
              if (!localw1.e()) {
                break;
              }
              localObject = localw1.d();
              if (!bool2)
              {
                if (paramk2 != null)
                {
                  if (bool2) {
                    continue;
                  }
                  if (!paramk2.getBool(localObject)) {}
                }
                else
                {
                  this.a.a(localObject, arrayOfbb[(paramk1.getInt(localObject) - paramInt1)].a(localObject));
                }
              }
              else {
                this.e += 1;
              }
              localw1.f();
            } while (!bool1);
          } while (bool2);
          j = 0;
        }
      }
    }
    do
    {
      if (j >= arrayOfbb.length) {
        break;
      }
      localObject = arrayOfbb[j];
      v localv = this.d.b(localObject);
      w localw2 = ((bb)localObject).l();
      if (localw2.e())
      {
        this.b.a(localw2.d(), localv);
        localw2.f();
      }
      for (;;)
      {
        if (!bool2) {
          if (!bool1)
          {
            if (!bool1) {
              break;
            }
            if (bool2) {
              continue;
            }
            j++;
          }
        }
      }
    } while (!bool1);
  }
  
  public void e()
  {
    this.c.a(this.b);
    this.c.a(this.a);
  }
  
  public boolean a()
  {
    if (!d.e) {}
    return this.e == 0;
  }
  
  public boolean a(e parame)
  {
    return this.b.get(parame) != null;
  }
  
  public int f()
  {
    return this.e;
  }
  
  public void a(e parame, int paramInt)
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    this.e += 1;
    if (!bool2) {
      if (this.d.isEmpty())
      {
        locala_ = new a_(paramInt);
        a(this.d.a(locala_), locala_.b(parame), parame);
        return;
      }
    }
    a_ locala_ = (a_)this.d.a();
    if (!bool2)
    {
      if (locala_.q() > paramInt)
      {
        if (locala_.q() > paramInt) {
          locala_ = new a_(locala_.q() - 1);
        }
        while (bool2)
        {
          this.d.a(locala_);
          if ((!bool2) && (bool1)) {
            break label155;
          }
          if (!bool1) {
            break;
          }
        }
        a(this.d.f(), locala_.b(parame), parame);
        label155:
        return;
      }
      locala_ = (a_)this.d.d();
      if (bool2) {}
    }
    else if (locala_.q() < paramInt)
    {
      if (locala_.q() < paramInt) {
        locala_ = new a_(locala_.q() + 1);
      }
      while (bool2)
      {
        this.d.b(locala_);
        if ((!bool2) && (bool1)) {
          break label248;
        }
        if (!bool1) {
          break;
        }
      }
      a(this.d.g(), locala_.b(parame), parame);
      label248:
      return;
    }
    v localv = this.d.f();
    if (localv != null) {}
    while (bool2)
    {
      locala_ = (a_)localv.c();
      if ((!bool2) && (bool1)) {
        return;
      }
      if (!bool2)
      {
        if (locala_.q() != paramInt) {
          localv = localv.a();
        }
      }
      else {
        if (!bool1) {
          break;
        }
      }
    }
    a(localv, locala_.b(parame), parame);
  }
  
  private void a(v paramv1, v paramv2, e parame)
  {
    this.b.a(parame, paramv1);
    this.a.a(parame, paramv2);
  }
  
  public void b(e parame, int paramInt)
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    v localv1 = (v)this.a.get(parame);
    v localv2 = (v)this.b.get(parame);
    a_ locala_ = (a_)localv2.c();
    int i = locala_.q();
    do
    {
      while (!bool1)
      {
        if (paramInt >= i) {
          break;
        }
        e(parame);
        i--;
      }
    } while (bool2);
  }
  
  public int b(e parame)
  {
    v localv = (v)this.b.get(parame);
    a_ locala_ = (a_)localv.c();
    return locala_.q();
  }
  
  public void c(e parame, int paramInt)
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    v localv1 = (v)this.a.get(parame);
    v localv2 = (v)this.b.get(parame);
    a_ locala_ = (a_)localv2.c();
    int i = locala_.q();
    do
    {
      while (!bool1)
      {
        if (paramInt <= i) {
          break;
        }
        d(parame);
        i++;
      }
    } while (bool2);
  }
  
  public e b()
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    do
    {
      do
      {
        if (!((bb)this.d.a()).isEmpty()) {
          break;
        }
        if (bool1) {
          break label51;
        }
        this.d.b();
      } while (!bool1);
    } while (bool2);
    label51:
    return ((bb)this.d.a()).o();
  }
  
  public void d()
  {
    this.d.clear();
    this.e = 0;
  }
  
  public void c(e parame)
  {
    v localv1 = (v)this.a.get(parame);
    v localv2 = (v)this.b.get(parame);
    this.a.a(parame, null);
    this.b.a(parame, null);
    bb localbb = (bb)localv2.c();
    localbb.h(localv1);
  }
  
  public e c()
  {
    return g();
  }
  
  public e g()
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    do
    {
      do
      {
        if (!((bb)this.d.a()).isEmpty()) {
          break;
        }
        if (bool2) {
          break label65;
        }
        this.d.b();
        if (bool1) {
          break label58;
        }
      } while (!bool1);
    } while (bool2);
    this.e -= 1;
    label58:
    label65:
    e locale = ((bb)this.d.a()).o();
    this.b.a(locale, null);
    this.a.a(locale, null);
    return locale;
  }
  
  public e h()
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    do
    {
      do
      {
        if (!((bb)this.d.d()).isEmpty()) {
          break;
        }
        if (bool2) {
          break label65;
        }
        this.d.e();
        if (bool1) {
          break label58;
        }
      } while (!bool1);
    } while (bool2);
    this.e -= 1;
    label58:
    label65:
    e locale = ((bb)this.d.d()).o();
    this.b.a(locale, null);
    this.a.a(locale, null);
    return locale;
  }
  
  public void d(e parame)
  {
    v localv1 = (v)this.a.get(parame);
    v localv2 = (v)this.b.get(parame);
    a_ locala_ = (a_)localv2.c();
    Object localObject = null;
    v localv3 = localv2.a();
    if ((d.e) || (localv3 != null))
    {
      localObject = (bb)localv3.c();
      this.b.a(parame, localv3);
    }
    else
    {
      localObject = new a_(locala_.q() + 1);
      this.b.a(parame, this.d.b(localObject));
    }
    locala_.h(localv1);
    this.a.a(parame, ((bb)localObject).a(parame));
  }
  
  public void e(e parame)
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    v localv1 = (v)this.a.get(parame);
    v localv2 = (v)this.b.get(parame);
    a_ locala_ = (a_)localv2.c();
    Object localObject = null;
    v localv3 = localv2.b();
    if ((bool2) || (localv3 != null))
    {
      localObject = (bb)localv3.c();
      this.b.a(parame, localv3);
    }
    else
    {
      localObject = new a_(locala_.q() - 1);
      this.b.a(parame, this.d.a(localObject));
    }
    locala_.h(localv1);
    this.a.a(parame, ((bb)localObject).a(parame));
    if ((bool2) || (q.n))
    {
      if (!bool2) {}
      d.d = !bool1;
    }
    if (q.o) {
      d.e = !bool2;
    }
  }
  
  static int a(q paramq)
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    int i = 1;
    do
    {
      w localw = paramq.v();
      while (!bool1)
      {
        if (!localw.e()) {
          break;
        }
        if (!bool2)
        {
          if (bool1) {
            break label64;
          }
          i = Math.max(i, localw.d().c());
          localw.f();
        }
      }
    } while (bool2);
    label64:
    return i;
  }
  
  static class a_
    extends bb
  {
    int h;
    
    a_(int paramInt)
    {
      this.h = paramInt;
    }
    
    int q()
    {
      return this.h;
    }
  }
  
  static class b_
    extends p
  {
    public int getInt(Object paramObject)
    {
      return ((e)paramObject).c();
    }
    
    public boolean getBool(Object paramObject)
    {
      return true;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.i.a.o

 * JD-Core Version:    0.7.0.1

 */